package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Time;
import java.util.List;

/**
 * The persistent class for the work_office database table.
 */
@Entity
@Table(name = "work_office")
@NamedQueries({
        @NamedQuery(name = "WorkOffice.findAll", query = "SELECT w FROM WorkOffice w"),
        @NamedQuery(name = "WorkOffice.findById", query = "SELECT w FROM WorkOffice w WHERE w.id = :id"),
        @NamedQuery(name = "WorkOffice.findByDescription", query = "SELECT w FROM WorkOffice w WHERE w.description = :description"),
        @NamedQuery(name = "WorkOffice.findByStartTime", query = "SELECT w FROM WorkOffice w WHERE w.startTime = :startTime"),
        @NamedQuery(name = "WorkOffice.findByEndTime", query = "SELECT w FROM WorkOffice w WHERE w.endTime = :endTime")})
public class WorkOffice implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Column(nullable = false, length = 255)
    private String description;

    @Column(name = "end_time", nullable = false)
    private Time endTime;

    @Column(name = "start_time", nullable = false)
    private Time startTime;

    // bi-directional many-to-one association to Employee
    @OneToMany(mappedBy = "workOffice")
    private List<Employee> employees;

    public WorkOffice() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Time getEndTime() {
        return this.endTime;
    }

    public void setEndTime(Time endTime) {
        this.endTime = endTime;
    }

    public Time getStartTime() {
        return this.startTime;
    }

    public void setStartTime(Time startTime) {
        this.startTime = startTime;
    }

    public List<Employee> getEmployees() {
        return this.employees;
    }

    public void setEmployees(List<Employee> employees) {
        this.employees = employees;
    }

}